<%@page import="cz.acies.data.process.UserProcessor"%>
<%@ page import="cz.acies.data.*"%>
<%@ page import="cz.acies.data.persist.*"%>
<%@ page import="com.google.gson.Gson"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%--@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" --%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

String theme = "metro";
UserContext uCtx = (UserContext) session.getAttribute("uCtx");
if (uCtx == null) {
	
} else if (uCtx.getLogin() != null && uCtx.getLogin().getPerson() != null) {
	//UserPerson up = (UserPerson) uCtx.getLogin().getPerson();
	UserProcessor process = new UserProcessor();
	UserPerson person = process.refreshUserPerson((UserPerson) uCtx.getLogin().getPerson());
	uCtx.getLogin().setPerson(person);
}
System.out.println("displayName: " + application.getServletContextName());
System.out.println("uCtx: "+uCtx);
%>
<!DOCTYPE html">
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<link rel="stylesheet" type="text/css" href="<%=path%>/libs/themes/<%=theme%>/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/libs/themes/icon.css">
<style type="text/css">
body {
	font-family: sans-serif, Helvetica, Verdana;
	font-size: 11px;
	margin: 0px;
}
.icon-menu{ background: url("<%=path%>/res/icons/000/16/settings.png") no-repeat center center; }
.icon-accounts{ background: url("<%=path%>/res/icons/999/16/accounts.png") no-repeat center center; }
.icon-calendar{ background: url("<%=path%>/res/icons/999/16/calendar.png") no-repeat center center; }
.icon-contacts{ background: url("<%=path%>/res/icons/999/16/contacts.png") no-repeat center center; }
.icon-email{ background: url("<%=path%>/res/icons/999/16/email.png") no-repeat center center; }
.icon-files{ background: url("<%=path%>/res/icons/999/16/files.png") no-repeat center center; }
.icon-users{ background: url("<%=path%>/res/icons/999/16/users.png") no-repeat center center; }

</style>

<script type="text/javascript" src="<%=path%>/libs/jquery-1.9.1.js"></script>
<script type="text/javascript" src="<%=path%>/libs/jquery.easyui.min.js"></script>
<script type="text/javascript">
$(document.body).ready(function() {});
</script>
</head>
<body class="easyui-layout">
	<div id="topPanel" data-options="region:'north',border:false" style="height:50px; background-color:#ececec; padding: 10px; overflow: hidden;">
		<table>
			<tr>
				<td style="width: 100%">
					<div style='padding:0px;font-size: 20px;color: #666'>Acies Genea 2014</div>
				</td>
			<td>
				<div style="padding:0px;">
					<a id="modulMenuBtn" href="javascript:void(0);" class="easyui-menubutton"></a>
					<script type="text/javascript">
					$("#modulMenuBtn").menubutton({
						menu: "#modulMenu",
						iconCls: "icon-menu"
					});
					</script>
				</div>
				<div id="modulMenu" style="width:150px;">
					<div>
						<span id="MN.R.000001">CRM</span>
						<div style="width:150px;">
							<div data-options="iconCls: 'icon-contacts'">Kontakty</div>
							<div data-options="iconCls: 'icon-calendar'">Kalendář</div>
							<div data-options="iconCls: 'icon-email'">Pošta</div>
							<div data-options="iconCls: 'icon-files'">Soubory</div>
						</div>
					</div>
					<div>
						<span id="MN.R.000002">Banka</span>
						<div style="width:150px;">
							<div data-options="iconCls: 'icon-accounts'">Bankovní účty</div>
						</div>
					</div>
					<div>
						<span id="MN.R.000003">Ostanní</span>
						<div style="width:150px;">
							<div data-options="iconCls: 'icon-users'">Uživatel</div>
						</div>
					</div>
					<div id="MN.R.000004">Odhlásit</div>
					</div>
					<script type="text/javascript">
					$("#modulMenu").menu({
						onClick: function(item) {
							var url = "/organizer/pages/desktop_ajax.jsp?processId=loadModul&modulId="+item.id;
							$("#modulTabs").panel("refresh", url);
							$("#modulTabs").panel({ fit: true, title: ""+item.text });
							$("#modulTabs").css({ "overflow": "hidden" });
							//addPanel(item.id, item.text);
						}
					});
					</script>
				</td>
			</tr>
		</table>
	</div>
	<div id="modulTabs" data-options="region:'center',title:'Welcome',border:true" style="padding: 0px;"></div>
	
	<div id="tab-tools">
		<a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload'"></a>
	</div>
	<script type="text/javascript">
	</script>
</body>
</html>
